home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Georgia Wildfire Prevention
/
Georgia Wildfire Prevention.iso
/
pc
/
media
/
dirs
/
BackUp
/
Credits.dir
/
00007_Script_Special Button Behavior
< prev
next >
Wrap
Text File
|
2002-10-11
|
3KB
|
77 lines
--PROPERTIES--
--Hot: The member switched to (hot state).
--FlashSpeed: The speed in which the sprite flashes measured in ticks (1/60th of a sec.)
--Message: The message sent to the stage.
--Glowing: Lets the function know if the sprite is hot or cold.
--RollOvr: The member switched to when rolled-over.
--ButtonSound: The sound that will play when clicked. Channel 2 is reserved for short sounds.
--TimeTracker: Times out the seconds between flashes.
--SpNum: The sprite number of the sprite.
--MyNum: The member's number.
--FlashWait: How long to wait before flashing
global zeus
property Hot, FlashSpeed, Message, Glowing, RollOvr, ButtonSound, TimeTracker, SpNum, MyNum, FlashWait
--Captures the spritenumber.
on new me
SpNum = me.spritenum
MyNum=sprite(SpNum).member.number
end
--Creates the dialog box for the behavior.
on getpropertydescriptionlist me
set pList = [#Hot:[#comment: "What is the cast member name for the Hot state?", #format: #string, #default: ""], \
#RollOvr: [#comment: "Which member would you like to use for the rollover?", #format: #string, #default: ""], \
#ButtonSound:[#comment: "What sound would you like to play when the button is pressed?",#format:#string,#default:"Click"],\
#Message:[#comment:"What movie would you like to open?",#format:#string,#default: "Next"],\
#FlashSpeed:[#comment: "How often would you like the member to flash (ticks)?", #format: #integer, #range: [#min: 0, #max: 60], #default: 0], \
#FlashWait: [#comment: "How Long would you like to wait before Flashing (ticks)?", #format:#integer, #default: "0"]]
return plist
end
--This toggles the flashing object back and forth at the desired speed while the mouse is not over it.
--on prepareframe me
-- if FlashSpeed <> 0 then
-- if the timer > FlashWait then
-- if sprite(SpNum).cursor <> 280 then
-- set TimeTracker = the ticks
-- repeat while the ticks < TimeTracker + FlashSpeed
-- nothing
-- end repeat
-- if Glowing = 0 then
-- sprite(SpNum).membernum = member(Hot).number
-- Glowing = Glowing + 1
-- else
-- sprite(SpNum).membernum = member(MyNum).number
-- Glowing = GLowing - 1
-- end if
-- updateStage
-- end if
-- end if
-- end if
--end
--This is for the rollover.
on mouseenter me
sprite(SpNum).membernum = member(RollOvr).number
sprite(SpNum).cursor = 280
updateStage
end
on mouseleave me
sprite(SpNum).membernum = member(MyNum).number
sprite(SpNum).cursor = 293
-- Glowing = 0
updateStage
end
--This goes to another frame and tells the movie what to do. Also plays the sound, if any.
on mousedown me
if ButtonSound <> "" then
sound(2).play(member(ButtonSound))
end if
WhichMovie (zeus, message)
end